package com.jsm.twentyfour.transfer;

import com.jsm.twentyfour.domain.Account;
import com.jsm.twentyfour.domain.Room;
import com.jsm.twentyfour.dto.AccountDTO;
import com.jsm.twentyfour.dto.RoomDTO;
import com.kejin.util.autoCoding.CU;

/**
 * create by jsm on 2019/1/23
 */
public class RoomTransfer {
    public static void main(String[] args) {
        CU.d(Room.class, RoomDTO.class);
        CU.d(RoomDTO.class, Room.class);
    }
    public static RoomDTO transfer(Room room){
        if(room==null){
            return null;
        }
        RoomDTO roomDTO = new RoomDTO();
        roomDTO.setStatus(room.getStatus());
        roomDTO.setUpdateAt(room.getUpdateAt());
        roomDTO.setCreateAt(room.getCreateAt());
        roomDTO.setId(room.getId());
        roomDTO.setCreaterId(room.getCreaterId());
        return roomDTO;
    }





    public static Room transfer(RoomDTO roomDTO){
        if(roomDTO==null){
            return null;
        }
        Room room = new Room();
        room.setStatus(roomDTO.getStatus());
        room.setUpdateAt(roomDTO.getUpdateAt());
        room.setCreateAt(roomDTO.getCreateAt());
        room.setId(roomDTO.getId());
        room.setCreaterId(roomDTO.getCreaterId());
        return room;
    }



}
